Refactor: Replace ThunkAction
with CompositeAction
and Enhance State Management in GraphProvider
#49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to replace the
ThunkAction
type withCompositeAction
across various files in theapp/(playground)/p/[agentId]/beta-proto
directory. Additionally, there are updates to theGraphProvider
component to improve state management.Type Replacement:
app/(playground)/p/[agentId]/beta-proto/flow/composite-actions.ts
: Changed the type ofrunFlow
function fromThunkAction
toCompositeAction
. (app/(playground)/p/[agentId]/beta-proto/flow/composite-actions.tsL2-R10)app/(playground)/p/[agentId]/beta-proto/giselle-node/components/panel/prompt.tsx
: Updated imports and function types fromThunkAction
toCompositeAction
. (app/(playground)/p/[agentId]/beta-proto/giselle-node/components/panel/prompt.tsxL26-R26, app/(playground)/p/[agentId]/beta-proto/giselle-node/components/panel/prompt.tsxL47-R47)app/(playground)/p/[agentId]/beta-proto/graph/actions.ts
: Replaced multipleThunkAction
types withCompositeAction
in various functions. (app/(playground)/p/[agentId]/beta-proto/graph/actions.tsL54-R54, app/(playground)/p/[agentId]/beta-proto/graph/actions.tsL174-R174, app/(playground)/p/[agentId]/beta-proto/graph/actions.tsL271-R271, app/(playground)/p/[agentId]/beta-proto/graph/actions.tsL472-R472, app/(playground)/p/[agentId]/beta-proto/graph/actions.tsL818-R818, app/(playground)/p/[agentId]/beta-proto/graph/actions.tsL1056-R1056, app/(playground)/p/[agentId]/beta-proto/graph/actions.tsL1236-R1236)app/(playground)/p/[agentId]/beta-proto/graph/context.ts
: ChangedThunkAction
type definition toCompositeAction
. (app/(playground)/p/[agentId]/beta-proto/graph/context.tsL5-R9)State Management Improvement:
app/(playground)/p/[agentId]/beta-proto/graph/provider.tsx
: Enhanced state management by using auseRef
to keep track of the current state and updated theenhancedDispatch
function to use this ref. (app/(playground)/p/[agentId]/beta-proto/graph/provider.tsxL34-R64)